<template>
    <rx-dialog @handOk="handleSubmit" @cancel="cancel">
        <rx-layout>
            <div slot="center">
                <a-form-model ref="form" :model="mdl" :rules="rules" :label-col="labelCol" :wrapper-col="wrapperCol">
                    <a-form-model-item :label="i18n('form.languageName','语言名称')" prop="languageName">
                        <a-input :placeholder="i18n('form.languageName','语言名称','input')" v-model="mdl.languageName"/>
                    </a-form-model-item>
                    <a-form-model-item :label="i18n('form.languageType','语言类型')" prop="languageType">
                        <a-input :placeholder="i18n('form.languageType','语言类型','input')" v-model="mdl.languageType"/>
                    </a-form-model-item>
                    <a-form-model-item :label="i18n('form.isDisable','是否可用')" prop="languageType">
                        <a-switch v-model="isDisable"/>
                    </a-form-model-item>
                </a-form-model>
            </div>
        </rx-layout>
    </rx-dialog>
</template>
<script>
    import SysMultiLingualApi from '@/api/system/core/sysMultiLingual'
    import {RxDialog, BaseFormModel} from "@lowcode/jpaas-common-lib";


    export default {
        name: 'SysMultiLingualEdit',
        mixins: [BaseFormModel],
        components: {
            RxDialog,
        },
        data() {
            return {
                /**
                 * 子表列表，以及表格属性
                 */
                subTable: {},
                rules: {
                    languageType: [{required: false, message: this.i18n('form.languageType','语言类型','input'), trigger: 'change'}],
                    languageName: [{required: false, message: this.i18n('form.languageName','语言名称','input'), trigger: 'change'}],
                    deleted: [{required: false, message: this.i18n('msa.delInfo','请输入逻辑删除'), trigger: 'change'}],
                },
                isDisable:true
            }

        },
        methods: {
            i18n(name,text,key){
                return this.$ti18(name,text,"SysMultiLingual",key);
            },
            get(id) {
                return SysMultiLingualApi.get(id);
            },
            onload_(data){
                if("NO"==data.isDisable){
                    this.isDisable=false;
                }
            },
            save() {
                this.mdl.isDisable=this.isDisable?'YES':'NO';
                return SysMultiLingualApi.save(this.mdl);
            },

        }
    }
</script>
<style>
    .relick a {
        margin-right: 10px;
    }

</style>
